﻿using ConfExpert.Forms.Base;
using ConfExpert.Forms.ImportWizards.GomlekCekiListesi;
using DevExpress.XtraEditors.Repository;
using DevTeam;
using System;
namespace ConfExpert.Forms.Lojistik
{
    public partial class ImportPL : XForm
    {
        public ImportPL()
        {
            InitializeComponent();
        }

        private void ImportPL_Load(object sender, EventArgs e)
        {
            gleCustomer.Edit.Assign(RI(Rp.V_Customer));
            ((RepositoryItemGridLookUpEdit)gleCustomer.Edit).TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
            gleCustomer.EditValueChanged += gleCustomer_EditValueChanged;

            btnAktar.ItemClick += btnAktar_ItemClick;
            btnKaydet.ItemClick += btnKaydet_ItemClick;
        }

        void btnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            throw new NotImplementedException();
        }

        void btnAktar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Aktar();
        }

        void gleCustomer_EditValueChanged(object sender, EventArgs e)
        {
            Aktar();
        }

        private void Aktar()
        {
            switch (gleCustomer.EditValue.ToInt())
            {
                case 75:
                    using (WB tb = new WB())
                        tb.ShowDialog();
                    break;

                case 269:
                    using (Reiss tb = new Reiss())
                        tb.ShowDialog();
                    break;

                case 100:
                    using (BillyReid tb = new BillyReid())
                        tb.ShowDialog();
                    break;

                case 20:
                    using (GP tb = new GP())
                        tb.ShowDialog();
                    break;
            }
        }
    }
}
